Skip to content

Conversation

karlseguin
Copy link
Contributor

Some old code / workarounds that are no longer needed.


document.getElementById('product-image').src = product.image;
document.getElementById('small-product-image-1').src = product.image;
document.getElementById('small-product-image-2').src = product.images[0];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix doesn't really works.
If you remove the 3 following lines (which use the setAttribute) the images are not correctly updated.

expected

    <div class="col-2">
      <img id="product-image" src="images/nomad_000.jpg" alt="" width="100%">

      <div class="small-img-row">
        <div class="small-img-col">
          <img id="small-product-image-1" src="images/nomad_000.jpg" alt="" width="100%" class="small-img">
        </div>
        <div class="small-img-col">
          <img id="small-product-image-2" src="images/nomad_001.jpg" alt="" width="100%" class="small-img">
        </div>
      </div>

current

    <div class="col-2">
      <img id="product-image" src="" alt="" width="100%">

      <div class="small-img-row">
        <div class="small-img-col">
          <img id="small-product-image-1" src="" alt="" width="100%" class="small-img">
        </div>
        <div class="small-img-col">
          <img id="small-product-image-2" src="" alt="" width="100%" class="small-img">
        </div>
      </div>
    </div>

@karlseguin karlseguin closed this May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants